<template>
	<view class="container">
		<view class="content">
			<view class="list">
				<view class="label">
					姓名
				</view>
				<view class="detail">
					{{dataList.name}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					手机号
				</view>
				<view class="detail">
					{{dataList.phone}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					申请编号
				</view>
				<view class="detail">
					{{dataList.id}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					代理地区
				</view>
				<view class="detail">
					{{dataList.province}}-{{dataList.city}}-{{dataList.area}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					代理类型
				</view>
				<view class="detail">
					{{dataList.type==1?"省级":dataList.type==2?"市级":"区级"}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					申请时间
				</view>
				<view class="detail">
					{{dataList.createtime|dateFormat}}
				</view>
			</view>
			<view class="list">
				<view class="label">
					申请状态
				</view>
				<view class="detail status" :class="[dataList.status==0?'checking':dataList.status==1?'success':'fail']">
					{{dataList.status==0?"待审核":dataList.status==1?"通过":"驳回"}}
				</view>
			</view>
			<view class="list reason" v-if="dataList.status==2?true:false">
				<view class="label">
					驳回理由：
				</view>
			</view>
			<view class="reason-detail" v-if="dataList.status==2?true:false">
				{{dataList.reject_reason}}
			</view>
		</view>
	</view>
</template>

<script>
	import service from '@/store/service.js';
	export default {
		data() {
			return {
				dataList: {}
			};
		},
		methods: {
			getApplyInfo() {
				this.$http.post(service.api.profile.getApplyInfo).then(res => {
					if (res.code === 1) {
						this.dataList = res.data
					} else {
						this.$api.msg(res.info)
					}
				})
			}
		},
		onLoad() {
			this.getApplyInfo()
		}
	}
</script>

<style lang="less">
	.container {
		padding: 20rpx;

		.content {
			background-color: #FFFFFF;
			padding: 0 20rpx;
			box-sizing: border-box;

			.list {
				display: flex;
				height: 110rpx;
				border-bottom: 1px solid #E4E7EA;
				align-items: center;

				.label {
					font-size: 26rpx;
					font-weight: 500;
					width: 180rpx;
				}

				.detail {}

				.status {
					font-size: 30rpx;
					font-weight: 600;
				}

				.fail {
					color: #fa3534;
				}

				.checking {
					color: #ff9900;
				}

				.success {
					color: #19be6b;
				}
			}

			.reason {
				border-bottom: 0;
			}

			.reason-detail {
				margin-top: -20rpx;
				padding-bottom: 20rpx;
				font-size: 32rpx;
				color: red;
			}
		}
	}
</style>
